<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/11/18
  Time: 14:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>。
<html>
<head>
  <title>监测系统</title>
  <style>
    table {
      width: 60%;
      margin: 0 auto;
    }

    a {
      text-decoration: none;
    }

    .add {
      padding: 5px 10px;
      border: 1px solid  blue;
      background-color:  lightpink;
    }
  </style>
</head>
<body>
<table border="1" align="center">
  <tr>
    <td colspan="7">雨量检测信息</td>
  </tr>
  <tr>
    <td>编号</td>
    <td>区域名称</td>
    <td>监测时间</td>
    <td>雨量值</td>
    <td>监测站</td>
    <td>站点地址</td>
    <td>操作</td>
  </tr>
  <c:forEach items="${lists}" var="info">
    <tr>
      <td>${info.id}</td>
      <td>${info.cityname}</td>
      <td>${info.createtime}</td>
      <td>${info.rainvalue}</td>
      <td>${info.detection}</td>
      <td>${info.address}</td>
        <%--<td><a href="/delete?id=${info.id}">删除</a></td>--%>
      <td><a href="javascript:void(0);" onclick="del(${info.id});">删除</a></td>
    </tr>
  </c:forEach>
</table>
<br>
<div align="center">
  <a class="add" href="add.jsp">添加人员</a></div>

<script src="static/js/jquery-1.8.3.min.js"></script>
<script>
  $(function () {
    $("tr:even").css("background-color", "pink");
    $("tr:odd").css("background-color", "blue");

  });

  function del(id) {
    if (confirm("确认删除吗？")) {
      location.href='/delete?id='+id;
    }
  }
</script>
</body>
</html>
